<?php
    $this->load->view('admin/users-nav');
?>
<div class="form_content">
    <?php if(isset($filter)) echo $filter; ?>
    <table class="list" style="width: 100%;margin-bottom: 10px;">
        <tr>
            <th class="left" style="width: 35%">HỌ VÀ TÊN</th>
            <th class="left" style="width: 20%">TÊN ĐĂNG NHẬP</th>
            <th class="left" style="width: 20%">EMAIL</th>
            <th class="left" style="width: 20%">QUYỀN</th>
            <th class="right" style="width: 5%">CHỨC NĂNG</th>
        </tr>

        <?php
        foreach($users as $index => $user):
        $style = $index % 2 == 0 ? 'even' : 'odd';
        ?>
        <tr class="<?php echo $style ?>">
            <td><?php echo $user->fullname;?></td>
            <td style="white-space:nowrap;"><?php echo $user->username;?></td>
             <td class="left"><?php echo $user->email;?></td>
            <td class="left" style="white-space:nowrap;"><?php echo $user->role;?></td>
            <td class="right" style="white-space:nowrap;" class="action">
                <a class="edit" href="/dashboard/users/edit/<?php echo $user->id;?>" ><em>&nbsp;</em></a>
                <a class="del" href="/dashboard/users/delete/<?php echo $user->id;?>" onclick="return confirm('Bạn có chắc chắn muốn xóa người dùng này không?');" ><em>&nbsp;</em></a>
            </td>
        <?php endforeach;?>
        <?php $left_page_links = 'Trang ' . $page . ' / ' . $total_pages . ' (<span>Tổng: ' . $total_rows . '</span>)'; ?>
        <tr class="list-footer">
            <th colspan="7" class="left"><?php echo $left_page_links; ?></th>
        </tr>
    </table>
</div>
<?php if(isset($page_links) && $page_links!=='') echo '<div class="pagination" style="margin-left:20px;">' . $page_links . '</div>'; ?>